/*
 * @Copyright: 2016 www.yyfax.com Inc. All rights reserved.
 */
package com.jaws.core.compatible.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 是否枚举
 * TODO 如果枚举都转移到数据库了,则从数据库加载出来后,主动设置到values里面.
 * 
 * @author buyi
 * @date 2016-12-06 09:19:10
 * @since v1.0.0
 */
public enum YesNoEnum {

	/** 枚举集合 */
	/** 是 */
	YES("1", "是"),
	/** 否 */
	NO("0", "否");

	private String value;
	private String remark;

	private YesNoEnum(String value, String remark) {
		this.value = value;
		this.remark = remark;
	}
	
	public String getValue() {
		return value;
	}

	

	public String getRemark() {
		return remark;
	}

	public boolean isValue(String value) {
		return getValue().equals(value);
	}

	public static final YesNoEnum fromValue(String value) {
		for (YesNoEnum e : YesNoEnum.values()) {
			if (StringUtils.equals(value, e.getValue())) {
				return e;
			}
		}
		return null;

	}
}
